<!-- MRWE03（双人综合成绩6轮） -->
<template>
  <div>
    <div class="item-info">
      <div
        :class="['single-item', item.flag ? 'active-item' : '']"
        v-for="(item, index) in singleItemList"
        :key="index"
      >
        <div>{{ item.name }}</div>
        <div class="item-logo">
          <img :src="item.logo" alt="" />
        </div>
      </div>
      <div class="single-item-info">
        <div class="info-line1">
          <div>{{ gameTitle }}</div>
          <div class="venue">{{ venueName }}</div>
        </div>
        <div class="info-line2">
          <div class="report-name">综合成绩公告</div>
          <div>{{ gameTime }}</div>
        </div>
      </div>
    </div>
    <div class="score-table-data" style="width: 100%">
      <el-table :data="reportData" style="width: 100%" stripe border>
        <template v-for="(item, index) in tableHeader">
          <el-table-column
            :label="item.label"
            :prop="item.prop"
            :fixed="item.fixed"
            min-width="140px"
          ></el-table-column>
        </template>
      </el-table>
    </div>
  </div>
</template>
<script>
import { mapState } from 'vuex'
export default {
  created() {
    this.venueName = this.$route.query.venueName
    this.gameTime = this.$route.query.gameTime
    this.gameTitle = this.$route.query.gameTitle
    this.filePath = this.$route.query.filePath
    this.getReportData()
  },
  props: {},
  data() {
    return {
      tableHeader: [
        { prop: 'Rank', label: '名次', fixed: 'left' },
        { prop: 'No', label: '编号' },
        { prop: 'Team', label: '单位' },
        { prop: 'Name', label: '姓名' },
        { prop: 'Score1', label: '第1轮成绩' },
        { prop: 'Score2', label: '第2轮成绩' },
        { prop: 'Score3', label: '第3轮成绩' },
        { prop: 'Score4', label: '第4轮成绩' },
        { prop: 'Score5', label: '第5轮成绩' },
        { prop: 'Score6', label: '第6轮成绩' },
        { prop: 'Score', label: '总积分' },
        { prop: 'MPPerc', label: 'MP%' },
        { prop: 'IfMatch', label: '相遇' },
        { prop: 'WinCount ', label: '赢轮数' },
        { prop: 'TieCount', label: '平轮数' },
        { prop: 'LevelScore', label: '级分' },
        { prop: 'OppScore', label: '对手分', fixed: 'right' }
      ],
      filePath: '',
      venueName: '',
      gameTime: '',
      gameTitle: '',
      startList: [
        {
          Rank: 'A',
          No: '1',
          Team: '1',
          Name: '李轩豪 ',
          Score1: '2',
          Score2: '2',
          Score3: '3',
          Score4: '3',
          Score5: '5',
          Score6: '5',
          Score: '10',
          MPPerc: '1 ',
          IfMatch: '1',
          WinCount: '1',
          TieCount: '1',
          LevelScore: '1',
          OppScore: '1'
        }
      ],
      singleItemList: [
        {
          name: '掼牌（掼蛋）',
          logo: '',
          flag: true
        }
      ]
    }
  },
  watch: {},
  computed: {
    ...mapState({
      reportData: state => state.schedule.reportData
    })
  },
  filters: {},
  components: {},
  methods: {
    getReportData() {
      this.$store
        .dispatch('getReportData', this.filePath + '.txt')
        .then(_ => {})
        .catch(error => {
          console.log(error)
        })
    }
  }
}
</script>
<style scoped lang="scss">
@import '@/assets/scss/item.scss';
</style>
